home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / dev / gcc / geninline_920614.lha / inline-2.0 / keymap.h < prev    next >
C/C++ Source or Header  |  1992-06-14  |  2KB  |  87 lines

  1. #ifndef _INLINE_KEYMAP_H
  2. #define _INLINE_KEYMAP_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL extern struct KeymapBase*  KeymapBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME KeymapBase
  18. #endif
  19.  
  20. static __inline struct KeyMap *
  21. AskKeyMapDefault (BASE_PAR_DECL0)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct KeyMap * _res  __asm("d0");
  25.   register struct KeymapBase* a6 __asm("a6") = BASE_NAME;
  26.   __asm __volatile ("jsr a6@(-0x24)"
  27.   : "=r" (_res)
  28.   : "r" (a6)
  29.   : "a0","a1","d0","d1");
  30.   return _res;
  31. }
  32. static __inline LONG 
  33. MapANSI (BASE_PAR_DECL STRPTR string,long count,STRPTR buffer,long length,struct KeyMap *keyMap)
  34. {
  35.   BASE_EXT_DECL
  36.   register LONG  _res  __asm("d0");
  37.   register struct KeymapBase* a6 __asm("a6") = BASE_NAME;
  38.   register STRPTR a0 __asm("a0") = string;
  39.   register long d0 __asm("d0") = count;
  40.   register STRPTR a1 __asm("a1") = buffer;
  41.   register long d1 __asm("d1") = length;
  42.   register struct KeyMap *a2 __asm("a2") = keyMap;
  43.   __asm __volatile ("jsr a6@(-0x36)"
  44.   : "=r" (_res)
  45.   : "r" (a6), "r" (a0), "r" (d0), "r" (a1), "r" (d1), "r" (a2)
  46.   : "a0","a1","a2","d0","d1");
  47.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;
  48.   return _res;
  49. }
  50. static __inline WORD 
  51. MapRawKey (BASE_PAR_DECL struct InputEvent *event,STRPTR buffer,long length,struct KeyMap *keyMap)
  52. {
  53.   BASE_EXT_DECL
  54.   register WORD  _res  __asm("d0");
  55.   register struct KeymapBase* a6 __asm("a6") = BASE_NAME;
  56.   register struct InputEvent *a0 __asm("a0") = event;
  57.   register STRPTR a1 __asm("a1") = buffer;
  58.   register long d1 __asm("d1") = length;
  59.   register struct KeyMap *a2 __asm("a2") = keyMap;
  60.   __asm __volatile ("jsr a6@(-0x2a)"
  61.   : "=r" (_res)
  62.   : "r" (a6), "r" (a0), "r" (a1), "r" (d1), "r" (a2)
  63.   : "a0","a1","a2","d0","d1");
  64.   *(char *)a0 = *(char *)a0;  *(char *)a1 = *(char *)a1;  *(char *)a2 = *(char *)a2;
  65.   return _res;
  66. }
  67. static __inline void 
  68. SetKeyMapDefault (BASE_PAR_DECL struct KeyMap *keyMap)
  69. {
  70.   BASE_EXT_DECL
  71.   register struct KeymapBase* a6 __asm("a6") = BASE_NAME;
  72.   register struct KeyMap *a0 __asm("a0") = keyMap;
  73.   __asm __volatile ("jsr a6@(-0x1e)"
  74.   : /* no output */
  75.   : "r" (a6), "r" (a0)
  76.   : "a0","a1","d0","d1");
  77.   *(char *)a0 = *(char *)a0;
  78. }
  79. #undef BASE_EXT_DECL
  80. #undef BASE_PAR_DECL
  81. #undef BASE_PAR_DECL0
  82. #undef BASE_NAME
  83.  
  84. __END_DECLS
  85.  
  86. #endif /* _INLINE_KEYMAP_H */
  87.